<%--
 *  File:    BusinessUnlockSalesNumReport.jsp
 *  @Author: JackYin
 *  Date:    2011/07/13
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.BusinessUnlockSalesNumReport"); 

  //init param
  String strModuleName = "COM";
  String privilegeCode = "R30020";
  String contextPath = request.getContextPath();
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>DTPurchaseSalesInvReport</title>
<PageFlow:CheckPageFlow pageName="p_dtpurchasesalesinvreport"/>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%@ include file="/rpt/ReportURL.inc" %>
<script>
 function page_go(){

	var bigzonecode = cform.bigzonecode.options[cform.bigzonecode.selectedIndex].value;
	var prodid =cform.prodid.value;
	var customerid =cform.customerid.value;
	var url = "<%= reportURL%>" + "/preview?__report=/ovalreport/BusinessUnlockSalesQty.rptdesign&sessionid=<%=session.getId()%>&year=" 
			+ cform.year.value + "&month=" + cform.month.value +"&employeeid="+cform.userid.value+"&__locale=zh_CN";
	if(!isEmpty(bigzonecode)) url += "&bigzonecode=" + bigzonecode;
	if(!isEmpty(prodid)) url += "&prodid=" + prodid;
	if(!isEmpty(customerid)) url += "&customerid=" + customerid;
	document.iframe.location.href = url;
 }

 function popDealer() { 
	  opt = "dealer";
	  var status = "height=450, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
			var url = "<%=contextPath%>/tdr/dataconfirm/PathOrgSelect.jsp?areacode="+areacode+"&o_thread=" + Math.random();
			url += "&globalpccode=112,113,114,117";
			if (typeof popwindow != 'undefined') popwindow.close();
			popwindow = window.open(url, "newwindow", status);
	}
	
	function popCustomer() {
	  opt = "customer";
	  areacode = cform.bigzonecode.options[cform.bigzonecode.selectedIndex].value;
	  var status = "height=450, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
			var url = "<%=contextPath%>/tdr/dataconfirm/PathOrgSelect.jsp?areacode="+areacode+"&o_thread=" + Math.random();
			url += "&globalpccode=99,112,117";
			
			if (typeof popwindow != 'undefined') popwindow.close();
			popwindow = window.open(url, "newwindow", status);
	}
	
	function page_setOrg(id, name, code) {
	  if(opt == "dealer"){
	  	cform.dealerid.value=id;
	  	cform.dealercode.value = code;
	  	cform.dealername.value = name;
	  }
	  if(opt == "customer"){
	  	cform.customerid.value=id;
	  	cform.customercode.value = code;
	  	cform.customername.value = name;
	  }	
	  opt = "";
	  if (popwindow != null)
	    popwindow.close();
	}




function popProduct() {
		  var status = "height=250, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
				var url = "ProductAllSelect.jsp?o_thread=" + Math.random();
				
				if (typeof popwindow != 'undefined') popwindow.close();
				popwindow = window.open(url, "newwindow", status);
		}



function page_setprod(id, name, code){
	cform.prodid.value=id;
  	cform.prodcode.value = code;
  	cform.prdn.value = name;
	
}
	
 
</script>
</head>
<body>
<% //--------------------------------------  page location --%>
	<%@ include file="/inc/PageLocation.inc" %>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher"  target="_self">
<custom:hidden property="userid" name="userinfo" scope="session"></custom:hidden>
	<input type="hidden" name="pagename" value="p_dtpurchasesalesinvreport">
	<input type="hidden" name="actionname">
   <tr>
    <td> 
      <table width="100%" border="0" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center" 
style="background:url(<%= contextPath %>/images/<%= strLanguageCode %>/title_2_bg.jpg) repeat-x; " height="36">
         <tr>
         	<td width="10%">&nbsp;</td>
          	<% 
				java.util.Calendar cal = java.util.Calendar.getInstance();      
				String year = cal.get(Calendar.YEAR)+"";     
				String month = cal.get(Calendar.MONTH)+"";
				if(cal.get(Calendar.MONTH) == 0){
					month = "12";
					year = (cal.get(Calendar.YEAR)-1)+"";
				} 
			%>
          	<td class="td_right" width="5%"><%= label.getLabelName("L_Year")%> <font color="red">*</font>：</td>
            <td width="5%">
            	<custom:selectdic property="year" dictType="Years" command="notnull" value="<%=year %>" label="L_Year1"/>
            </td>
         	<td class="td_right" width="5%"><%= label.getLabelName("L_Month")%><font color="red">*</font>：</td>
          	<td width="5%">
            	<custom:selectdic property="month" dictType="Months" command="notnull" value="<%=month %>" label="L_Month"/>
            </td>
         	<td class="td_right" width="5%"><%= label.getLabelName("L_Businessarea") + label.getLabelName("L_Colon") %></td>
            <td class="td_right" width="5%"><custom:select optionInnerTextKey="areaname" optionsName="areas" optionValueKey="areacode" property="bigzonecode" defaultValue="ALL" defaultValueCost=""/></td>
         	
         		<td width="6%"><%= label.getLabelName("L_VendorBusinessName") + label.getLabelName("L_Colon") %></td>
	            <td width="20%">
	          	<custom:text property="customercode" size="8" readonly="true"/>
	            <a onclick="javascript:popCustomer();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
	            <custom:text property="customername" readonly="true" size="25"/>
	            <custom:hidden property="customerid" />
	            </td>
	        
         	 	<td class="td_right" width="5%"><%= label.getLabelName("L_Products") + label.getLabelName("L_Colon") %></td>
                <td width="20%">
	          	<custom:text property="prodcode" size="8" readonly="true"/>
	            <a onclick="javascript:popProduct();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
	            <custom:text property="prdn" readonly="true" size="20"/>
	            <custom:hidden property="prodid" />
	            </td>
         	
         	<td width="3%"><a href="javascript:page_go()"><img src="<%= contextPath %>/images/<%= strLanguageCode %>/go_fy.gif" border="0" style="border: 1 solid #000000"></a></td>
         	<td width="*%">&nbsp;</td>
         </tr>
       </table>
    </td>
  </tr>
  </form>
</table>
       <iframe src="<%= contextPath %>/Blank.jsp" frameborder=0 width="100%" height="87%" name="iframe"></iframe>
</body>
</html>